package com.gears.quartz;

import java.io.IOException;

import javax.annotation.Resource;

import org.apache.log4j.Logger;

import com.gears.bachUpload.service.BachUploadService;
import com.gears.filecover.service.CmsFile;
import com.gears.filecover.service.FileConverter;
import com.gears.filecover.service.LoginCmsFile;
import com.gears.filecover.service.RetrainFile;

/**
 * 微课s
 * @author leo
 *
 */
public class FileMoveTask {
	
	
	private Logger logger = Logger.getLogger(this.getClass());
	@Resource(name = "hehe")
	private BachUploadService bachUploadService;

	@Resource
	private FileConverter fileConverter;

	@Resource
	private LoginCmsFile loginCmsFile;

	@Resource
	private CmsFile cmsFile;

	@Resource
	private RetrainFile retrainFile;
	
	public void execute() {
		try {
			logger.info("------开始作业------");
			bachUploadService.run();
			Thread.sleep(6000);
			logger.info("------结束作业------");
		} catch (Exception ex) {
			logger.error("作业出错", ex);
		}
	}
	public void executeCover(){
		try {
			logger.info("------开始作业1------");
			fileConverter.cover();
			logger.info("------结束作业1------");
			logger.info("---------------------------------------------");
			logger.info("------开始作业2------");
			loginCmsFile.cover();
			logger.info("------结束作业2------");
			logger.info("---------------------------------------------");
			logger.info("------开始作业3------");
			cmsFile.cover();
			logger.info("------结束作业3------");
			logger.info("---------------------------------------------");
			logger.info("------开始作业4------");
			retrainFile.cover();
			logger.info("------结束作业4------");
			logger.info("---------------------------------------------");
		} catch (Exception e) {
			logger.error("作业出错", e);
		}
	}

}
